#include<stack>
#include<iostream>
using namespace std;
int main()
{
	stack<char> a;
	char ch;
	while(cin>>ch && ch!='@')
	{
		if(ch==')')
		{
			if(!a.empty())
				a.pop();
			else
			{
				cout<<"NO";
				return 0;
			}
		}
		else if(ch=='(')
			a.push(ch);
	}
	if(!a.empty())
		cout<<"NO";
	else
		cout<<"YES";
	return 0;
}
